'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Namespace OLE

    <ComImport()> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    <Guid(IID.OLE.IStorage)> _
    Public Interface IStorage
        <PreserveSig()> Function CreateStream(<MarshalAs(UnmanagedType.BStr)> ByVal pwcsName As String, ByVal grfMode As UInteger, ByVal reserved1 As UInteger, ByVal reserved2 As UInteger, <Out()> ByRef ppstm As IStream) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OpenStream(<MarshalAs(UnmanagedType.BStr)> ByVal pwcsName As String, ByVal reserved1 As IntPtr, ByVal grfMode As UInteger, ByVal reserved2 As UInteger, <Out()> ByRef ppstm As IStream) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function CreateStorage(<MarshalAs(UnmanagedType.BStr)> ByVal pwcsName As String, ByVal grfMode As UInteger, ByVal reserved1 As UInteger, ByVal reserved2 As UInteger, <Out()> ByRef ppStg As IStorage) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function OpenStorage(<MarshalAs(UnmanagedType.BStr)> ByVal pwcsName As String, ByRef pstgPriority As IOLE.IStorage, ByVal grfMode As UInteger, ByVal snbExclude As IntPtr, ByVal reserved As UInteger, <Out()> ByRef ppStg As IStorage) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function CopyTo(ByVal ciidExclude As UInteger, <MarshalAs(UnmanagedType.LPArray)> ByRef pIIDExclude() As Guid, <MarshalAs(UnmanagedType.LPWStr)> ByRef snbExclude As String, ByRef stgDest As IStorage) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function MoveElementTo(<MarshalAs(UnmanagedType.BStr)> ByVal pwcsName As String, ByRef stgDest As IStorage, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwcsNewName As String, ByVal grfFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Commit(ByVal grfCommitFlags As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Revert() As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function EnumElements(ByVal reserved1 As UInteger, ByVal reserved2 As IntPtr, ByVal reserved3 As UInteger, <Out()> ByRef ppVal As IEnumSTATSTG) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function DestroyElement(<MarshalAs(UnmanagedType.LPWStr)> ByVal pwcsName As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function RenameElement(<MarshalAs(UnmanagedType.LPWStr)> ByVal pwcsOldName As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal pwcsNewName As String) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetElementTimes(<MarshalAs(UnmanagedType.LPWStr)> ByVal pwcsName As String, ByRef pctime As FileTime, ByRef patime As FileTime, ByRef pmtime As FileTime) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetClass(ByRef clsid As Guid) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function SetStateBits(ByVal grfStateBits As UInteger, ByVal grfMask As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        <PreserveSig()> Function Stat(<Out()> ByRef pStatStg As StatStg, ByVal grfStatFlag As StatFlag) As <MarshalAs(UnmanagedType.Error)> Integer
    End Interface

End Namespace